package xyz.sxcloud.gkcrm.system.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xyz.sxcloud.gkcrm.system.entity.ScBasicInfo;
import xyz.sxcloud.gkcrm.system.entity.UserAccount;
import xyz.sxcloud.gkcrm.system.service.ScBasicInfoService;
import xyz.sxcloud.gkcrm.system.service.UserAccountService;

import java.util.List;

@RestController
public class testController {
    @Autowired
    private UserAccountService userAccountService;
    @Autowired
    private ScBasicInfoService scBasicInfoService;

    @RequestMapping("/test")
    public String test() {
        return "Hello springBoot!";
    }

    @RequestMapping("/getUserList")
    public List<UserAccount> queryAllUserAccount() {
        return userAccountService.queryAllUserAccount();
    }

    @RequestMapping(value = "/queryUserListByPage")
    public List<UserAccount> queryUserListByPage(@RequestParam(value = "page", defaultValue = "1") Integer page
            , @RequestParam(value = "size", defaultValue = "25") Integer size) {
        return userAccountService.queryUserListByPage(page, size);
    }

    @RequestMapping(value = "/querySCInfoListByPage")
    public List<ScBasicInfo> querySCInfoListByPage(@RequestParam(value = "page", defaultValue = "1") Integer page
            , @RequestParam(value = "size", defaultValue = "10") Integer size) {
        return scBasicInfoService.querySCInfoListByPage(page, size);
    }

}
